FROM node:16.4.1 as BUILD_IMAGE

WORKDIR /app

COPY package*.json ./
RUN npm install --registry=http://repo.qdlxjt.cn/repository/npm-group/

COPY . ./
RUN npm run build
FROM nginx:1.19.3

COPY --from=BUILD_IMAGE /app/dist /app/www/lxcs-admin/lxp
COPY --from=BUILD_IMAGE /app/docker/default.conf.template /etc/nginx/templates/

CMD ["nginx", "-g", "daemon off;"]
